import request from '@/utils/request'

// 查询
export function listInventory(query) {
  return request({
    url: '/service/api/inventory_center/list',
    method: 'get',
    params: query
  })
}

// 查询
export function getInventory(id) {
  return request({
    url: '/service/api/inventory_center/info/' + id,
    method: 'get'
  })
}

// 新增
export function addInventory(data) {
  return request({
    url: '/service/api/inventory_center/add',
    method: 'post',
    data: data
  })
}

// 修改
export function updateInventory(data) {
  return request({
    url: '/service/api/inventory_center/edit',
    method: 'post',
    data: data
  })
}

// 修改库存
export function updStock(data) {
  return request({
    url: '/service/api/inventory_center/upd_stock',
    method: 'post',
    data: data
  })
}


// 删除
export function delInventory(id) {
  // return request({
  //   url: '/service/designator/' + id,
  //   method: 'delete'
  // })
}

// 出入库记录
export function inventoryRecord(data) {
  return request({
    url: '/service/api/inventory_center/inventory_record',
    method: 'get',
    params: data
  })
}
// 预警配置查询
export function waringConfInfo(id) {
  return request({
    url: '/service/api/inventory_center/waring_conf_info/' + id,
    method: 'get'
  })
}

// 修改预警配置
export function setWarningConf(data) {
  return request({
    url: '/service/api/inventory_center/set_warning_conf',
    method: 'post',
    data: data
  })
}